//
//  CFRMDishesListCell.swift
//  CrazyFatReducingMeal
//
//  Created by iOS-Czz on 2023/10/29.
//

import UIKit

class CFRMDishesListCell: UITableViewCell {

    @IBOutlet var pairedLabel: UILabel!
    @IBOutlet var nutritionLabel: UILabel!
    @IBOutlet var recommendLabel: UILabel!
    @IBOutlet var nameLabel: UILabel!
    var clickEditBlock: (() -> Void)?
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    var model: CFRMDishesModel? {
        didSet {
            self.nameLabel.text = self.model?.name
            self.recommendLabel.text = "Recommendation index: " + self.model!.recommendation
            self.nutritionLabel.text = "nutrition: " + self.model!.nutrition
            self.pairedLabel.text = self.model?.paired
        }
    }
    @IBAction func clickEditAction(_ sender: Any) {
        clickEditBlock?()
    }
}
